<template>
  <div class="app">
    <h2>我是App组件(父组件)</h2>
    <h3>School组件（子组件）给我的学校名是：{{SchoolName}}</h3>
    <hr>
	<School :getName = "getName"/>
    <br>  
  </div>
</template>

<script>
    import School from './components/School'
    export default {
        name:'App',
        components:{School},
        data(){
            return{
                SchoolName:''
            }
        },
        methods: {
            getName(value){
                console.log('输出为:',value)
                this.SchoolName = value
            }
        },
    }
</script>

<style>
  .app{
      background-color: gray;
      padding: 20px;
  }
</style>